const yamlConf = require('../app/utils/YamlConf');
const conf = yamlConf.load('mysql');

const sequelize = {
  dialect: 'mysql', // support: mysql, mariadb, postgres, mssql
  database: conf.database,
  host: conf.host,
  port: conf.port,
  username: conf.username,
  password: conf.password,
  define: {
    // 锁定表名和模型名一致，不自动转为复数
    freezeTableName: true,
  },
  pool: {
    max: 5,
    min: 0,
    acquire: 30000,
    idle: 10000,
  },
};
module.exports = sequelize;
